@import "~scss/variables";

.sw-media-compact-upload-v2.sw-media-upload-v2 {
    .sw-media-upload-v2__dropzone {
        min-height: unset;
        padding: 6px;
        background-color: $color-gray-50;
    }

    .sw-media-upload-v2__button {
        margin: 0 4px 0 0;
        min-width: unset;
    }

    .sw-media-upload-v2__preview {
        width: 32px;
        height: 32px;
    }

    .sw-media-upload-v2__actions {
        flex-direction: row;
        justify-content: flex-end;
        align-items: stretch;
        overflow: unset;
        width: auto;
    }

    .sw-media-compact-upload-v2__preview-wrapper {
        display: flex;
        column-gap: 8px;
        margin: 0;
        overflow-x: auto;
        width: 100%;
    }

    .sw-media-compact-upload-v2__preview-item {
        position: relative;

        &::after {
            content: "";
            display: block;
            width: 100%;
            height: 100%;
            position: absolute;
            border-radius: $border-radius-default;
            z-index: 1;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

        .sw-media-upload-v2__preview {
            margin-right: 0;
        }

        .sw-media-preview-v2__placeholder {
            padding: 4px;
        }

        .sw-context-button {
            position: absolute;
            z-index: 2;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .sw-context-button__button {
            border: 0 none;
            visibility: hidden;
            color: $color-white;
        }

        &:hover {
            &::after {
                background: rgba(0, 0, 0, 50%);
            }

            .sw-context-button__button {
                visibility: initial;
            }
        }
    }

    .sw-media-upload-v2__dropzone.is--multi {
        flex-direction: row;

        .sw-media-upload-v2__actions {
            margin: 0;
        }
    }

    .sw-media-compact-upload-v2__browse-button {
        padding: 10px;
    }

    .sw-media-compact-upload-v2__browse-icon {
        width: 14px;
        height: 14px;

        &.mt-icon > svg {
            // Important is needed because the selector to be override is a id selector
            width: 100% !important;
            height: 100% !important;
        }
    }

    .sw-media-compact-upload-v2__label {
        display: block;
        line-height: 16px;
        font-size: $font-size-xs;
        margin-bottom: 8px;
        color: $color-darkgray-200;
        font-weight: normal;
        user-select: none;
    }
}
